Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix opensearch theme version #978

Closed

Conversation

zuochengding
Copy link
Contributor

@zuochengding zuochengding commented Nov 24, 2021

Signed-off-by: Zuocheng Ding [email protected]

Description

This PR will update the old kibana theme version and tag to v1 and v2.

[EDIT] : The new revision will change the default theme version to v1 and remove the beta theme

Issues Resolved

Check List

  • New functionality includes testing.
    • All tests pass
      • yarn test:jest
      • yarn test:jest_integration
      • yarn test:ftr
  • New functionality has been documented.
  • Commits are signed per the DCO using --signoff

@zuochengding zuochengding requested a review from a team as a code owner November 24, 2021 01:59
@zuochengding zuochengding self-assigned this Nov 24, 2021
@kavilla
Copy link
Member

kavilla commented Nov 24, 2021

Nit: Can we update the commit to include more details and have a description. Doesn't have to be much and you can add the issue in there as well.

@kavilla kavilla linked an issue Nov 24, 2021 that may be closed by this pull request
@kavilla
Copy link
Member

kavilla commented Nov 24, 2021

For tracking purposes related to this PR. Can we say we manually verified this will not break backwards compatibility?

@zuochengding
Copy link
Contributor Author

zuochengding commented Nov 24, 2021

For tracking purposes related to this PR. Can we say we manually verified this will not break backwards compatibility?

Yes, the PR has no logical change but just updates the naming of the themes. This will only affect the UI. From my local testing, there is no behavior change. In theory, there shouldn't have any regression issue. However, one thing I have to mention here is that v2 (or the original v8(beta)) has some legacy SCSS compiling errors in console.

kavilla
kavilla previously approved these changes Nov 24, 2021
ananzh
ananzh previously approved these changes Nov 29, 2021
Copy link
Member

@ananzh ananzh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tmarkley
Copy link
Contributor

I think we should consider just using the default and removing this option as Jules mentioned in #494.

@jcgraybill
Copy link

Yes, let's get @ahopp to take a look at this before merging - to weigh in on what to call these two alternative themes, or whether to just standardize on a single theme.

@tmarkley tmarkley requested a review from ahopp November 30, 2021 20:38
@ahopp
Copy link
Contributor

ahopp commented Dec 9, 2021

@tmarkley sorry for the delay! I'm not seeing a ton of value in the "secondary" theme. For now, I think it would be better to standardize on a single theme. Do we have a good view of the differences between the two themes?

@zuochengding
Copy link
Contributor Author

@tmarkley sorry for the delay! I'm not seeing a ton of value in the "secondary" theme. For now, I think it would be better to standardize on a single theme. Do we have a good view of the differences between the two themes?

The theme (v8 beta) does't seem fully finished, I have noticed some layout cutting in UI (and errors in console as well) for the second theme (v8 beta). From this standing point, i think it is good to remove.

@ahopp
Copy link
Contributor

ahopp commented Dec 9, 2021

Roger, in that case it makes sense to align on the "v7" and begin any work on new theming can be resolved at a latter date. Thanks!

@kavilla
Copy link
Member

kavilla commented Dec 13, 2021

If any case, if we remove the option lets make sure it doesn't break any backwards compatibility on start up if someone from the legacy app had this setting to the beta.

boktorbb
boktorbb previously approved these changes Dec 13, 2021
Copy link
Contributor

@boktorbb boktorbb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with backwards compatibility verification; otherwise, looks good to me

@zuochengding
Copy link
Contributor Author

If any case, if we remove the option lets make sure it doesn't break any backwards compatibility on start up if someone from the legacy app had this setting to the beta.

Thanks @ananzh for helping me on backwards compatible testing from " odfe-1.13.2 vanilla version" to the "latest change". The UI looks good to me.

theme-version-testing

@zuochengding
Copy link
Contributor Author

@zuochengding are we targeting v2.0.0 for this change? Can we add tests that confirm that the v1 theme is properly set when either v7 or the v8 beta theme were selected previously?

Yes, we are targeting v2.0.0 and I will add more tests in next revision

Originally, in Advanced setting, there is a setting let you set theme version from `v7` to `v8(beta)`
implying version that do not exist yet.

Change the version label to `v1` as default theme and remove the beta version.
Hide `theme:version` UI from Advanced Setting since we have only one theme avaialble now.

Signed-off-by: Zuocheng Ding <[email protected]>
Copy link
Contributor

@tmarkley tmarkley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think before we merge this we should probably have integration and functional tests that confirm that no matter what setting was applied before updating, v1 is always applied.

Comment on lines +64 to +65
schema.literal('v7'),
schema.literal('v8 (beta)'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can't we remove these from the schema?

Copy link
Contributor Author

@zuochengding zuochengding Jan 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for backward compatibility, user's injectedMetadata from previous version is readonly and there is no way to modify it. The current system will do an initial schema validation during the startup, so you will see some warnings in console if we remove this fields. The way I proposed is to override the user injectedData after the data loaded (deep copied) into the memory (cache), then I override it as default value v1.

Comment on lines -61 to -62
expect(() => validate('v7')).not.toThrow();
expect(() => validate('v8 (beta)')).not.toThrow();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we keep these and expect them to throw?

Copy link
Contributor Author

@zuochengding zuochengding Jan 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same reason as above, It will be validated based on the schema we defined

@zuochengding
Copy link
Contributor Author

zuochengding commented Jan 14, 2022

I think before we merge this we should probably have integration and functional tests that confirm that no matter what setting was applied before updating, v1 is always applied.

I think the unit test might be sufficient because it covered the main concern for naming change. Just to make sure we are on same page, v1 isn't something new but just a renamed theme of v7. Compared with previous, only one theme will be loaded no matter what name it is. The only concern would be what is name will displayed to customer. The unit test will verify the override . Functional testing is something we could do but since we actually disabled/hided the from the Advanced Setting, not very sure if the value can be retrieved from UI level verification. I don't see much benefit for this since it is covered in unit test

@kavilla
Copy link
Member

kavilla commented Feb 7, 2022

@zuochengding, @tmarkley, in summation what would be the last things to get this PR in?

@@ -175,6 +177,17 @@ You can use \`IUiSettingsClient.get("${key}", defaultValue)\`, which will just r
return this.updateErrors$.asObservable();
}

resetThemeVersion() {
const key = 'theme:version';
// Reset userValue to default value if any legacy theme verion exists.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: typo verion should be version

const key = 'theme:version';
// Reset userValue to default value if any legacy theme verion exists.
if (
this.cache[key] !== undefined &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we set the value if the cache is undefined?

@tmarkley
Copy link
Contributor

tmarkley commented Feb 7, 2022

I think before we merge this we should probably have integration and functional tests that confirm that no matter what setting was applied before updating, v1 is always applied.

I think the unit test might be sufficient because it covered the main concern for naming change. Just to make sure we are on same page, v1 isn't something new but just a renamed theme of v7. Compared with previous, only one theme will be loaded no matter what name it is. The only concern would be what is name will displayed to customer. The unit test will verify the override . Functional testing is something we could do but since we actually disabled/hided the from the Advanced Setting, not very sure if the value can be retrieved from UI level verification. I don't see much benefit for this since it is covered in unit test

Apologies for not responding to this sooner. The unit test covers the functionality of resetThemeVersion, but we don't have anything that confirms whether that function is called in all scenarios and properly sets the theme for all users.

AMoo-Miki pushed a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this pull request Feb 10, 2022
AMoo-Miki pushed a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this pull request Feb 10, 2022
# [24.5.0](elastic/elastic-charts@v24.4.0...v24.5.0) (2021-01-30)

### Bug Fixes

* add theme min radius to point shape ([opensearch-project#996](elastic/elastic-charts#996)) ([98089a9](elastic/elastic-charts@98089a9))
* align tooltip z-index to EUI tooltip z-index ([opensearch-project#931](elastic/elastic-charts#931)) ([f7f1f6f](elastic/elastic-charts@f7f1f6f))
* chart state and series functions cleanup ([opensearch-project#989](elastic/elastic-charts#989)) ([42a7af0](elastic/elastic-charts@42a7af0))
* create unique ids for dot icons ([opensearch-project#971](elastic/elastic-charts#971)) ([0b3e00f](elastic/elastic-charts@0b3e00f))
* external tooltip legend extra value sync ([opensearch-project#993](elastic/elastic-charts#993)) ([7e1096e](elastic/elastic-charts@7e1096e))
* **legend:** disable focus and keyboard navigation for legend in partition ch… ([opensearch-project#952](elastic/elastic-charts#952)) ([dfff3e2](elastic/elastic-charts@dfff3e2))
* **legend:** hierarchical legend order should follow the tree paths ([opensearch-project#947](elastic/elastic-charts#947)) ([7b70186](elastic/elastic-charts@7b70186)), closes [opensearch-project#944](elastic/elastic-charts#944)
* **legend:** remove ids for circles ([opensearch-project#973](elastic/elastic-charts#973)) ([ed98481](elastic/elastic-charts@ed98481))

### Features

* **cursor:** improve theme styling for crosshair ([opensearch-project#980](elastic/elastic-charts#980)) ([0248ad6](elastic/elastic-charts@0248ad6))
* **legend:**  display pie chart legend extra ([opensearch-project#939](elastic/elastic-charts#939)) ([672a4df](elastic/elastic-charts@672a4df))
* **legend:** add keyboard navigation ([opensearch-project#880](elastic/elastic-charts#880)) ([b471a94](elastic/elastic-charts@b471a94))
* **partition:** Flame and icicle chart ([opensearch-project#965](elastic/elastic-charts#965)) ([9e8b1f7](elastic/elastic-charts@9e8b1f7))
* **partition:** legend hover options ([opensearch-project#978](elastic/elastic-charts#978)) ([acd1339](elastic/elastic-charts@acd1339))
* **xy:** support multiple point shapes on line, area and bubble charts ([opensearch-project#988](elastic/elastic-charts#988)) ([4f23b4f](elastic/elastic-charts@4f23b4f))
@kavilla
Copy link
Member

kavilla commented Apr 14, 2022

There's a lot of conflicts here and I think the PR still as to address changes. Should we remove the 2.0.0 label?

@tmarkley tmarkley added ux / ui Improvements or additions to user experience, flows, components, UI elements and removed v2.0.0 labels Apr 14, 2022
kavilla added a commit to kavilla/OpenSearch-Dashboards-1 that referenced this pull request May 18, 2022
There is currently to a PR to remove the v7 and v8 (beta) theme
versions within the application but it is getting stale:
opensearch-project#978

Since the v8 (beta) theme isn't actually planned and has the incorrect
version, we do not want end users to be able to change this setting.
In the essence of time, this will prevent this setting from showing in
the Advanced Settings page but will also not break users who set this
version already (however it will lock them into theme until they switched
by manually updating or deleting the config doc). Removing this setting
will force the default to be v8 (beta).

Temporary fix for:
opensearch-project#494

But it should be removed completely.

Signed-off-by: Kawika Avilla <[email protected]>
kavilla added a commit to kavilla/OpenSearch-Dashboards-1 that referenced this pull request May 18, 2022
There is currently to a PR to remove the v7 and v8 (beta) theme
versions within the application but it is getting stale:
opensearch-project#978

Since the v8 (beta) theme isn't actually planned and has the incorrect
version, we do not want end users to be able to change this setting.
In the essence of time, this will prevent this setting from showing in
the Advanced Settings page but will also not break users who set this
version already (however it will lock them into theme until they switched
by manually updating or deleting the config doc). Removing this setting
will force the default to be v8 (beta).

Temporary fix for:
opensearch-project#494

But it should be removed completely.

Signed-off-by: Kawika Avilla <[email protected]>
kavilla added a commit that referenced this pull request May 19, 2022
There is currently to a PR to remove the v7 and v8 (beta) theme
versions within the application but it is getting stale:
#978

Since the v8 (beta) theme isn't actually planned and has the incorrect
version, we do not want end users to be able to change this setting.
In the essence of time, this will prevent this setting from showing in
the Advanced Settings page but will also not break users who set this
version already (however it will lock them into theme until they switched
by manually updating or deleting the config doc). Removing this setting
will force the default to be v8 (beta).

Temporary fix for:
#494

But it should be removed completely.

Signed-off-by: Kawika Avilla <[email protected]>
@kavilla kavilla added the v3.0.0 label May 19, 2022
@kavilla
Copy link
Member

kavilla commented May 19, 2022

Will close and link to the issue we did a temp work around for 2.0 but will need to remove this for 3.0

@kavilla kavilla closed this May 19, 2022
opensearch-trigger-bot bot pushed a commit that referenced this pull request May 19, 2022
There is currently to a PR to remove the v7 and v8 (beta) theme
versions within the application but it is getting stale:
#978

Since the v8 (beta) theme isn't actually planned and has the incorrect
version, we do not want end users to be able to change this setting.
In the essence of time, this will prevent this setting from showing in
the Advanced Settings page but will also not break users who set this
version already (however it will lock them into theme until they switched
by manually updating or deleting the config doc). Removing this setting
will force the default to be v8 (beta).

Temporary fix for:
#494

But it should be removed completely.

Signed-off-by: Kawika Avilla <[email protected]>
(cherry picked from commit 87e5412)
opensearch-trigger-bot bot pushed a commit that referenced this pull request May 19, 2022
There is currently to a PR to remove the v7 and v8 (beta) theme
versions within the application but it is getting stale:
#978

Since the v8 (beta) theme isn't actually planned and has the incorrect
version, we do not want end users to be able to change this setting.
In the essence of time, this will prevent this setting from showing in
the Advanced Settings page but will also not break users who set this
version already (however it will lock them into theme until they switched
by manually updating or deleting the config doc). Removing this setting
will force the default to be v8 (beta).

Temporary fix for:
#494

But it should be removed completely.

Signed-off-by: Kawika Avilla <[email protected]>
(cherry picked from commit 87e5412)
kavilla added a commit that referenced this pull request May 19, 2022
There is currently to a PR to remove the v7 and v8 (beta) theme
versions within the application but it is getting stale:
#978

Since the v8 (beta) theme isn't actually planned and has the incorrect
version, we do not want end users to be able to change this setting.
In the essence of time, this will prevent this setting from showing in
the Advanced Settings page but will also not break users who set this
version already (however it will lock them into theme until they switched
by manually updating or deleting the config doc). Removing this setting
will force the default to be v8 (beta).

Temporary fix for:
#494

But it should be removed completely.

Signed-off-by: Kawika Avilla <[email protected]>
(cherry picked from commit 87e5412)

Co-authored-by: Kawika Avilla <[email protected]>
kavilla added a commit that referenced this pull request May 19, 2022
There is currently to a PR to remove the v7 and v8 (beta) theme
versions within the application but it is getting stale:
#978

Since the v8 (beta) theme isn't actually planned and has the incorrect
version, we do not want end users to be able to change this setting.
In the essence of time, this will prevent this setting from showing in
the Advanced Settings page but will also not break users who set this
version already (however it will lock them into theme until they switched
by manually updating or deleting the config doc). Removing this setting
will force the default to be v8 (beta).

Temporary fix for:
#494

But it should be removed completely.

Signed-off-by: Kawika Avilla <[email protected]>
(cherry picked from commit 87e5412)

Co-authored-by: Kawika Avilla <[email protected]>
kavilla added a commit to kavilla/OpenSearch-Dashboards-1 that referenced this pull request Jun 8, 2022
…t#1598)

There is currently to a PR to remove the v7 and v8 (beta) theme
versions within the application but it is getting stale:
opensearch-project#978

Since the v8 (beta) theme isn't actually planned and has the incorrect
version, we do not want end users to be able to change this setting.
In the essence of time, this will prevent this setting from showing in
the Advanced Settings page but will also not break users who set this
version already (however it will lock them into theme until they switched
by manually updating or deleting the config doc). Removing this setting
will force the default to be v8 (beta).

Temporary fix for:
opensearch-project#494

But it should be removed completely.

Signed-off-by: Kawika Avilla <[email protected]>
kavilla added a commit to kavilla/OpenSearch-Dashboards-1 that referenced this pull request Jun 16, 2022
…t#1598)

There is currently to a PR to remove the v7 and v8 (beta) theme
versions within the application but it is getting stale:
opensearch-project#978

Since the v8 (beta) theme isn't actually planned and has the incorrect
version, we do not want end users to be able to change this setting.
In the essence of time, this will prevent this setting from showing in
the Advanced Settings page but will also not break users who set this
version already (however it will lock them into theme until they switched
by manually updating or deleting the config doc). Removing this setting
will force the default to be v8 (beta).

Temporary fix for:
opensearch-project#494

But it should be removed completely.

Signed-off-by: Kawika Avilla <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ux / ui Improvements or additions to user experience, flows, components, UI elements v3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Theme version references v7 and v8
8 participants